<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

<ui:composition template="/WEB-INF/templates/BasicTemplate.xhtml">

	<ui:define name="content">
		<c:set target="#{userBean}" property="action" value="ADD_TICKET" />
		<h:form id="ticketForm" rendered="#{userBean.permissions}">
			<h:panelGrid columns="2">

				<h:outputLabel value="Team A:" />
				<h:outputLabel value="#{sessionScope['game'].teamA}" />

				<h:outputLabel value="Team B:" />
				<h:outputLabel value="#{sessionScope['game'].teamB}" />

				<h:outputLabel value="Date:" />
				<h:outputLabel
					value="#{sessionScope['game'].day} -  #{sessionScope['game'].month} - #{sessionScope['game'].year}" />

				<h:outputLabel value="Time:" />
				<h:outputLabel
					value="#{sessionScope['game'].hour} :  #{sessionScope['game'].minute}" />

				<h:outputLabel value="Stadium:" />
				<h:outputLabel
					value="#{sessionScope['game'].stadium} in  #{sessionScope['game'].city}" />

				<h:outputLabel value="Sector:" />
				<h:selectOneMenu value="#{ticketBean.sector}">
					<f:selectItems value="#{ticketBean.sectors}" />
				</h:selectOneMenu>


				<h:commandButton id="buy" action="#{ticketBean.buy}" value="Buy" />
				<h:message for="buy" />


			</h:panelGrid>

		<h:outputScript library="js" name="jquery-1.7.1.min.js" />
		<h:outputScript library="js" name="stadium.js" />

		<canvas width="400px" height="300px" id="canvas"
			style=" margin: 0 auto; border: 1px solid black;"> Canvas
		not supported. </canvas>

		<script type="text/javascript">
			setScale(0.5);
			init2("#{sessionScope['game'].capacity}",
					"#{sessionScope['game'].tribunes[0]}",
					"#{sessionScope['game'].tribunes[1]}",
					"#{sessionScope['game'].tribunes[2]}",
					"#{sessionScope['game'].tribunes[3]}");
		</script>
		</h:form>
		<h:outputLabel value="You don't have permission to this page" rendered="#{!userBean.permissions}" />
	</ui:define>
</ui:composition>
</html>